using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Data.Models.Mapping
{
    public class ToolFormulaMap : EntityTypeConfiguration<ToolFormula>
    {
        public ToolFormulaMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Code)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ToolFormula");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.DesignDetailID).HasColumnName("DesignDetailID");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.ToolTypeID).HasColumnName("ToolTypeID");
            this.Property(t => t.UOMID).HasColumnName("UOMID");
            this.Property(t => t.Quantity).HasColumnName("Quantity");
            this.Property(t => t.ProductModelID).HasColumnName("ProductModelID");
        }
    }
}
